package com.ruoyi.community.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.community.mapper.OwnerRoomMapper;
import com.ruoyi.community.domain.OwnerRoom;
import com.ruoyi.community.service.IOwnerRoomService;

/**
 * 房屋绑定 Service业务层处理
 * 
 * @author Sea
 * @date 2025-01-02
 */
@Service
public class OwnerRoomServiceImpl implements IOwnerRoomService 
{
    @Autowired
    private OwnerRoomMapper ownerRoomMapper;

    /**
     * 查询房屋绑定 
     * 
     * @param ownerRoomId 房屋绑定 主键
     * @return 房屋绑定 
     */
    @Override
    public OwnerRoom selectOwnerRoomByOwnerRoomId(Long ownerRoomId)
    {
        return ownerRoomMapper.selectOwnerRoomByOwnerRoomId(ownerRoomId);
    }

    /**
     * 查询房屋绑定 列表
     * 
     * @param ownerRoom 房屋绑定 
     * @return 房屋绑定 
     */
    @Override
    public List<OwnerRoom> selectOwnerRoomList(OwnerRoom ownerRoom)
    {
        return ownerRoomMapper.selectOwnerRoomList(ownerRoom);
    }

    /**
     * 新增房屋绑定 
     * 
     * @param ownerRoom 房屋绑定 
     * @return 结果
     */
    @Override
    public int insertOwnerRoom(OwnerRoom ownerRoom)
    {
        ownerRoom.setCreateTime(DateUtils.getNowDate());
        return ownerRoomMapper.insertOwnerRoom(ownerRoom);
    }

    /**
     * 修改房屋绑定 
     * 
     * @param ownerRoom 房屋绑定 
     * @return 结果
     */
    @Override
    public int updateOwnerRoom(OwnerRoom ownerRoom)
    {
        ownerRoom.setUpdateTime(DateUtils.getNowDate());
        return ownerRoomMapper.updateOwnerRoom(ownerRoom);
    }

    /**
     * 批量删除房屋绑定 
     * 
     * @param ownerRoomIds 需要删除的房屋绑定 主键
     * @return 结果
     */
    @Override
    public int deleteOwnerRoomByOwnerRoomIds(Long[] ownerRoomIds)
    {
        return ownerRoomMapper.deleteOwnerRoomByOwnerRoomIds(ownerRoomIds);
    }

    /**
     * 删除房屋绑定 信息
     * 
     * @param ownerRoomId 房屋绑定 主键
     * @return 结果
     */
    @Override
    public int deleteOwnerRoomByOwnerRoomId(Long ownerRoomId)
    {
        return ownerRoomMapper.deleteOwnerRoomByOwnerRoomId(ownerRoomId);
    }
}
